package org.mule.integration.module;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Random;


public class CustomerRegistry {
	static List<String> names = new ArrayList<String>();
	static List<String> types = new ArrayList<String>();
	
	static{
		names.add("Tom");
		names.add("Jim");
		names.add("Tim");
		names.add("Jane");
		names.add("Lee");
		names.add("Joy");
		names.add("Neet");
		names.add("Kate");
		names.add("Jerry");
		names.add("Tod");
		types.add("member");
		types.add("common");
	}
    public static Collection<Customer> getCustomers()
    {
        List<Customer> list = new ArrayList<Customer>();
        for(int i = 0; i < 100; i++){
        	Customer cus = getCustomer();
        	list.add(cus);	
        }
        return list;
    }

	private static Customer getCustomer() {
        Customer cus = new Customer();
        Random random = new Random();
        int name = random.nextInt(10);
        cus.setName(names.get(name));
        int type = random.nextInt(2);
        cus.setType(types.get(type));
        int amount = random.nextInt(2000);
        cus.setAmount(amount);
        
		return cus;
	}
}
